<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
         
  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "file:src/test/resources/dtd/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"
    xmlns:concordion="http://www.concordion.org/2007/concordion"
    xmlns:isis="http://isis.apache.org/2010/concordion">
<link href="../../concordion.css" rel="stylesheet" type="text/css" />
<body>

<h1>Mark Item As Done</h1>

<div class="example">

<h2>Given</h2>
<p>
Given <a concordion:run="concordion"
        href="Fixture.html">this fixture</a></p>

<p>Locate to-do item:</p>
<table
    isis:execute="#result=usingIsisViewerThatArgs(#onObject, #aliasResultAs, #perform, #onMember, #thatIt, #value)">
    <tr>
        <th concordion:set="#onObject">on object</th>
        <th concordion:set="#aliasResultAs">alias result as</th>
        <th concordion:set="#perform">perform</th>
        <th concordion:set="#onMember">on member</th>
        <th concordion:assertEquals="#result" />
    </tr>
    <tr>
        <td>toDoItems</td>
        <td>listOfItemsBefore</td>
        <td>invoke action</td>
        <td>not yet done</td>
        <td>ok</td>
    </tr>
</table>

<p
    concordion:execute="#result=aliasItemsInList(#listAlias, #title, #aliasAs)">
... and then alias the '<span concordion:set="#title">Buy milk</span>' item in the returned <span
    concordion:set="#listAlias">listOfItemsBefore</span> as <span
    concordion:set="#aliasAs">buyMilkItem</span>; <span
    concordion:assertEquals="#result">ok</span>.</p>

<p>Confirm to-do item is not done:</p>
<table
    isis:execute="#result=usingIsisViewerThatArgs(#onObject, #aliasResultAs, #perform, #onMember, #thatIt, #value)">
    <tr>
        <th concordion:set="#onObject">on object</th>
        <th concordion:set="#aliasResultAs">alias result as</th>
        <th concordion:set="#perform">perform</th>
        <th concordion:set="#onMember">on member</th>
        <th concordion:set="#thatIt">that it</th>
        <th concordion:set="#value">value</th>
        <th concordion:assertEquals="#result" />
    </tr>
    <tr>
        <td>buyMilkItem</td>
        <td></td>
        <td>check property</td>
        <td>Done</td>
        <td>is</td>
        <td>False</td>
        <td>ok</td>
    </tr>
</table>



<h2>When</h2>

<p>Mark as done</p>
<table
	isis:execute="#result=usingIsisViewerThatArgs(#onObject, #aliasResultAs, #perform, #onMember, #thatIt, #value)">
	<tr>
		<th concordion:set="#onObject">on object</th>
		<th concordion:set="#aliasResultAs">alias result as</th>
		<th concordion:set="#perform">perform</th>
		<th concordion:set="#onMember">on member</th>
		<th concordion:assertEquals="#result" />
	</tr>
    <tr>
        <td>buyMilkItem</td>
        <td></td>
        <td>invoke action</td>
        <td>mark as done</td>
        <td>ok</td>
    </tr>
</table>

<h2>Then</h2>
<p>Confirm item is done...</p>
<table
    isis:execute="#result=usingIsisViewerThatArgs(#onObject, #aliasResultAs, #perform, #onMember, #thatIt, #value)">
    <tr>
        <th concordion:set="#onObject">on object</th>
        <th concordion:set="#aliasResultAs">alias result as</th>
        <th concordion:set="#perform">perform</th>
        <th concordion:set="#onMember">on member</th>
        <th concordion:set="#thatIt">that it</th>
        <th concordion:set="#value">value</th>
        <th concordion:assertEquals="#result" />
    </tr>
    <tr>
        <td>buyMilkItem</td>
        <td></td>
        <td>check property</td>
        <td>Done</td>
        <td>is</td>
        <td>True</td>
        <td>ok</td>
    </tr>
</table>

<p>... and that when the list of items is obtained again...</p>
<table
    isis:execute="#result=usingIsisViewerThatArgs(#onObject, #aliasResultAs, #perform, #onMember, #thatIt, #value)">
    <tr>
        <th concordion:set="#onObject">on object</th>
        <th concordion:set="#aliasResultAs">alias result as</th>
        <th concordion:set="#perform">perform</th>
        <th concordion:set="#onMember">on member</th>
        <th concordion:assertEquals="#result" />
    </tr>
    <tr>
        <td>toDoItems</td>
        <td>listOfItemsAfter</td>
        <td>invoke action</td>
        <td>not yet done</td>
        <td>ok</td>
    </tr>
</table>

<p concordion:execute="#result=checkCollectionDoesNotContain(#listAlias,#alias)">
... then the <span concordion:set="#alias">buyMilkItem</span> is no 
longer in that list (<span concordion:set="#listAlias">listOfItemsAfter</span>);
  <span concordion:assertEquals="#result">ok</span>.
</p>

<!-- uncomment the line below to run up the DnD viewer -->
<!-- 
<p concordion:execute="runViewer()">run viewer</p>
--></div>

</body>
</html>
